package com.zgjkhis.modules.system.service;

import com.zgjkhis.common.service.BaseService;
import com.zgjkhis.domain.PageResult;
import com.zgjkhis.modules.charges.domain.vo.ExpenseDetail;
import com.zgjkhis.modules.charges.service.dto.InfoDrugCostDto;
import com.zgjkhis.modules.his.service.dto.DataPrescription;
import com.zgjkhis.modules.his.service.dto.DataPrescriptionDetail;
import com.zgjkhis.modules.statistics.resp.DrugRefundResp;
import com.zgjkhis.modules.system.domain.InfoDrug;
import com.zgjkhis.modules.system.domain.vo.DrugSaleVo;
import com.zgjkhis.modules.system.req.RefundReq;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author yzq
 * @Description 处方详情
 * @Date 2021/6/23 9:45
 * @Param
 * @return
 **/
public interface InfoDrugService extends BaseService<InfoDrug>{

    /**
     * @Author yzq
     * @Description 根据订单号查询费用明细
     * @Date 2021/7/14 9:44
     * @Param [orderNo]
     * @return java.util.List<com.zgjkhis.modules.charges.domain.vo.ExpenseDetail>
     **/
    List<ExpenseDetail> queryExpense(String orderNo);

    List<InfoDrug> queryInfoDrugList(String orderNo);

    /**
     * @Author yzq
     * @Description 根据订单号，分组查询处方总金额
     * @Date 2021/9/9 14:43
     * @Param [orderNo]
     * @return void
     **/
    List<InfoDrugCostDto> queryTotalFeeForInfo(String orderNo);

    /**
     * 根据处方单号，查询已支付过的药品清单个数
     * @param infoNo
     * @return
     */
    int queryInfoDrugByInfoNo(String infoNo);

    /**
     * 根据处方号查询处方列表
     * @param infoNo
     * @return
     */
    List<InfoDrug> queryInfoDrugListByInfoNo(String infoNo);

    List<DrugSaleVo> drugSale(String pharmacyId, String startDate, String endDate);

    PageResult<DrugSaleVo> drugStock(String pharmacyId, String drugId, String startDate, String endDate, String userName, String docName, String type, Pageable pageable);

    void outStockDetails(String pharmacyId,String drugId,String startDate,String endDate,String userName,String docName,String type, HttpServletResponse response) throws IOException;

    PageResult<DrugRefundResp> refundList(RefundReq refundReq, Pageable pageable);

    void outRefundList(RefundReq refundReq, HttpServletResponse response) throws IOException;

    List<DataPrescription> queryDataList();

    List<DataPrescriptionDetail> queryDataDetailList(String id, BigDecimal quantityDay);

    List<DataPrescription> queryInfoByOrderNo(String orderNo);
}
